<template>
  <view class="wrap">
    <uni-forms>
      <uni-forms-item>
        <uni-data-select label="电商平台" v-model="name" :localdata="form"></uni-data-select>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="订单编号:">
        <uni-easyinput v-model="value" placeholder="请输入内容"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="商品sku码:">
        <uni-easyinput v-model="value" placeholder="请输入内容"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="商品名称:">
        <uni-easyinput v-model="value" placeholder="请输入内容"></uni-easyinput>
      </uni-forms-item>

      <uni-forms-item label-width="150" label="库存">
        <uni-easyinput disabled v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="采购价">
        <uni-easyinput disabled v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="毛利润(总)">
        <uni-easyinput disabled v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="销售人员">
        <uni-easyinput disabled v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="购买时间">
        <uni-datetime-picker type="datetime" return-type="timestamp" v-model="baseFormData.datetimesingle" />
      </uni-forms-item>
      <uni-forms-item label-width="150" label="购买数量">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="销售单价">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="销售总价">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="客户姓名">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="客户电话">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="收货地址">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="客户单位">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="订单凭证">
        <uni-file-picker limit="1" title="上传图片"></uni-file-picker>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="发货状态">
        <!-- <uni-data-checkbox mode="button" multiple v-model="checkbox1" :localdata="range"> -->
        <uni-data-checkbox v-model="checkValue" :localdata="range"></uni-data-checkbox>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="发货时间">
        <uni-datetime-picker type="datetime" return-type="timestamp" v-model="baseFormData.datetimesingle" />
      </uni-forms-item>
      <uni-forms-item label-width="150" label="物流公司">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
      <uni-forms-item label-width="150" label="物流单号">
        <uni-easyinput v-model="value"></uni-easyinput>
      </uni-forms-item>
    </uni-forms>
    <button type="primary" size="mini" @click="submit('dynamicForm')">提交</button>
    <button type="default" size="mini">重置</button>
  </view>
</template>

<script>
  import {
    getPlatFormList
  } from '@/utils/order.js'
  export default {
    data() {
      return {
        form: {},
        name: '',
        range: [{
          value: 1,
          text: '是'
        }, {
          value: 2,
          text: '否'
        }],
        checkValue: 0
      };
    },
    onLoad() {
      this.getPlatFormData()
    },
    methods: {
      async getPlatFormData() {
        const res = await getPlatFormList({
          params: JSON.stringify({
            isWX: 1
          })
        })
        console.log(res)
        this.form = res.data.map(item => {
          return {
            id: item.id,
            text: item.name
          }
        })

        console.log(this.form, 'list');
      }
    }
  }
</script>

<style lang="scss" scoped>
  .wrap {
    padding: 20rpx;
    padding-bottom: 60rpx;

    /deep/.hide-on-phone {
      display: block;
    }

    /deep/ .uni-label-text {
      font-weight: 200;
      color: #000;
    }
  }
</style>